<?php

use Illuminate\Routing\Router;

Route::group([
    'prefix' => 'admin/tag',
    'namespace' => 'Frieza\\Modules\\Tag\\Controllers',
    'middleware' => [
        'web',
        'admin'
    ],
], function (Router $router) {

    // 标签列表
    $router->get('/list', 'TagController@list');
    //获取分类
    $router->get('/list/edit/tagtype/{q?}', 'TagController@getTagType');
    //获取关联标签
    $router->get('/list/edit/tag/relation{q?}', 'TagController@getTagRelation');
    // 编辑
    $router->get('/list/{id}/edit', 'TagController@edit');
    // 创建
    $router->get('/list/create', 'TagController@edit')->name('list.create');

    // 展示当前各种类型的标签的有效无效数据
    $router->get('/show', 'TagController@show');

    // 保存
    $router->post('/list/save', 'TagController@saveSubmit');
    // 删除
    $router->delete('/list/{id}', 'TagController@del');

    // 分类列表
    $router->get('/type/list', 'TagTypeController@list');
    // 删除一级分类
    $router->delete('/type/list/{id}', 'TagTypeController@delTagtype');
    // 一级分类编辑 / 二级分类展示
    $router->get('/type/list/{id}/edit', 'TagTypeController@editTagtype');
    // 一级分类创建
    $router->get('/type/list/create', 'TagTypeController@editTagtype');
    // 保存一级分类
    $router->post('/type/onesave', 'TagTypeController@saveOneTagtype');

    //二级分类创建
    $router->get('/type/list/{pid}/edit/create', 'TagTypeController@editTwoTagtype');
    // 二级分类编辑
    $router->get('/type/list/{pid}/edit/{id}/edit', 'TagTypeController@editTwoTagtype');
    // 二级分类保存
    $router->post('/type/list/twosave', 'TagTypeController@saveTwoTagtype');
    // 删除二级分类
    $router->delete('/type/list/{pid}/edit/{id}', 'TagTypeController@delTwoTagtype');

    $router->get('/bigTag/index', 'BigTagController@index');
    $router->get('/bigTag/index/create', 'BigTagController@edit');
    $router->get('/bigTag/index/{id}/edit', 'BigTagController@edit');
    $router->post('/bigTag/save', 'BigTagController@save');
    $router->delete('/bigTag/index/{id}', 'BigTagController@del');
    $router->post('/bigTag/sort', 'BigTagController@sort');
});
